Inside Macintosh: QuickTime Components

Previous | Chapter Top | Chapter Contents | Next

Working With Sequence Grabber Settings

Sequence grabber components can work with channel components and panel components to collect configuration settings from the user. The functions discussed in this section allow you to direct the sequence grabber to display its settings dialog box to the user and to work with the configuration of each of the grabber's channels. See "About Sequence Grabber Components" for more information about the relationship between the sequence grabber and panel components.

Use the SGSettingsDialog function to instruct the sequence grabber to display its settings dialog box to the user.

The SGSetSettings and SGGetSettings functions allow you to retrieve or set the sequence grabber's configuration.

The SGSetChannelSettings and SGGetChannelSettings functions work with the configuration of an individual channel.

SGSettingsDialog

You may cause the sequence grabber to display its settings dialog box to the user by calling the SGSettingsDialog function. The user can use this dialog box to specify the configuration of a sequence grabber channel.

pascal ComponentResult SGSettingsDialog (SeqGrabComponent s,
                                          SGChannel c, short numPanels,
                                          ConstComponentListPtr panelList, long flags,
                                          SGModalFilterUPP proc, long procRefNum);
s
Specifies the component instance that identifies your connection to the sequence grabber component. You obtain this value from the Component Manager's OpenDefaultComponent or OpenComponent function.
c
Identifies the channel to be configured. You provide your connection identifier. You connect to a channel component by calling the SGNewChannel or SGNewChannelFromComponent function, discussed on SGNewChannel and SGNewChannelFromComponent , respectively.
numPanels
Specifies the number of panel components to be listed in the panel component pop-up menu. You specify the panel components with the panelList parameter. You may use these parameters to limit the user's choice of panel components. If you set this parameter to 0 and the panelList parameter to nil , the sequence grabber lists all available panel components.
panelList
Contains a pointer to an array of component identifiers. The sequence grabber presents only these components in the panel component pop-up menu. You specify the number of identifiers in the array with the numPanels parameter. If you set this parameter to nil , the sequence grabber lists all available panel components.
flags
Reserved for Apple Computer. Set this parameter to 0.
proc
Specifies an event filter function. Because the sequence grabber's settings dialog box is a movable modal dialog box, you must supply an event filter function to process update events in your window. The interface that your filter function must support is described in "Application-Defined Functions," .
procRefNum
Contains a reference constant for use by your filter function.

Because the settings dialog box is a movable modal dialog box, you must provide an event filter function.

DESCRIPTION

The SGSettingsDialog function instructs the sequence grabber to display its settings dialog box to the user. The sequence grabber works with one or more panel components to configure a specified channel component.

If the user clicks OK and the settings are acceptable to the panel and channel components, this function returns a result code of noErr . Because the user may change several channel configuration parameters, your application should retrieve new configuration information from the channel so that you can update any values you save, such as the channel's display boundaries or the channel device. In particular, the video rectangle for the channels may be adjusted.

RESULT CODE

userCanceledErr

-128

User canceled the dialog

SEE ALSO

You may retrieve or set the configuration of one or more channel components by using the SGGetSettings (described in the next section), SGSetSettings (described on SGSetSettings ), SGGetChannelSettings (described on SGGetChannelSettings ), or SGSetChannelSettings function (described on SGSetChannelSettings ).

SGGetSettings

The SGGetSettings function retrieves the current settings of all channels used by the sequence grabber. The sequence grabber places all of this configuration information into a Movie Toolbox user data list.

pascal ComponentResult SGGetSettings (SeqGrabComponent s,
                                         UserData *ud, long flags);
s
Specifies the component instance that identifies your connection to the sequence grabber component. You obtain this value from the Component Manager's OpenDefaultComponent or OpenComponent function.
ud
Contains a pointer. The sequence grabber returns a pointer to a Movie Toolbox user data list that contains the configuration information. Your application is responsible for disposing of this user data list when you are done with it.
flags
Reserved for Apple. Set this parameter to 0.

DESCRIPTION

The SGGetSettings function allows you to retrieve the sequence grabber's configuration information. The sequence grabber, in turn, retrieves configuration information for each of its channels and stores that information in a Movie Toolbox user data list. You may subsequently use the SGSetSettings function (described in the next section) to reconfigure the sequence grabber. You can store the settings (for example, in a Preferences file) by using the Movie Toolbox's PutUserDataIntoHandle function.

RESULT CODES

Memory Manager errors

SEE ALSO

You may retrieve the configuration of one channel component by using the SGGetChannelSettings function (described on SGGetChannelSettings ).

SGSetSettings

The SGSetSettings function allows you to configure a sequence grabber and its channels.

pascal ComponentResult SGSetSettings (SeqGrabComponent s,
                                         UserData ud, long flags);
s
Specifies the component instance that identifies your connection to the sequence grabber component. You obtain this value from the Component Manager's OpenDefaultComponent or OpenComponent function.
ud
Specifies a Movie Toolbox user data list that contains the configuration information to be used by the sequence grabber.
flags
Reserved for Apple. Set this parameter to 0.

DESCRIPTION

The SGSetSettings function allows you to configure a sequence grabber. You provide this configuration information in a Movie Toolbox user data list. Typically, you obtain this configuration data from the SGGetSettings function, which is discussed in the previous section.

Note that the sequence grabber disposes of any of its current channels before applying this configuration information. It then opens connections to new channels as appropriate.

You can restore saved settings by using the Movie Toolbox's NewUserDataFromHandle function.

RESULT CODES

noDeviceForChannel

-9400

Channel component cannot find its device

couldntGetRequiredComponent

-9405

Component not found

deviceCantMeetRequest

-9408

Device cannot support grabber

SEE ALSO

You may set the configuration of one channel component by using the SGSetChannelSettings function (described on SGSetChannelSettings ).

You may use the SGGetIndChannel function (described on SGGetIndChannel ) to obtain information about each channel that the sequence grabber is using as a result of applying this new configuration.

SGGetChannelSettings

The SGGetChannelSettings function retrieves the current settings of one channel used by the sequence grabber. The sequence grabber places this configuration information into a Movie Toolbox user data list.

pascal ComponentResult SGGetChannelSettings (SeqGrabComponent s,
                                         SGChannel c,
                                         UserData *ud,
                                         long flags);
s
Specifies the component instance that identifies your connection to the sequence grabber component. You obtain this value from the Component Manager's OpenDefaultComponent or OpenComponent function.
c
Identifies the channel for this operation. You pass your connection identifier. You connect to a channel component by calling the SGNewChannel or SGNewChannelFromComponent function, discussed on SGNewChannel and SGNewChannelFromComponent , respectively.
ud
Contains a pointer. The sequence grabber returns a pointer to a Movie Toolbox user data list that contains the configuration information.
flags
Reserved for Apple. Set this parameter to 0.

DESCRIPTION

The SGGetChannelSettings function allows you to retrieve the configuration information for a single channel component. The channel component stores that information in a Movie Toolbox user data list. You may subsequently use the SGSetChannelSettings function to reconfigure the channel (this function is described next).

RESULT CODES

Memory Manager errors

SEE ALSO

You may retrieve the configuration of the entire sequence grabber, including all of its channels, by using the SGGetSettings function, described on SGGetSettings .

SGSetChannelSettings

The SGSetChannelSettings function allows you to configure a sequence grabber channel.

pascal ComponentResult SGSetChannelSettings (SeqGrabComponent s,
                                         SGChannel c,
                                         UserData ud,
                                         long flags);
s
Specifies the component instance that identifies your connection to the sequence grabber component. You obtain this value from the Component Manager's OpenDefaultComponent or OpenComponent function.
c
Identifies the channel to be configured. You provide your connection identifier. You connect to a channel component by calling the SGNewChannel or SGNewChannelFromComponent function, discussed on SGNewChannel and SGNewChannelFromComponent , respectively.
ud
Specifies a Movie Toolbox user data list that contains the configuration information to be used by the channel component.
flags
Reserved for Apple. Set this parameter to 0.

DESCRIPTION

The SGSetChannelSettings function allows you to configure a sequence grabber channel. You provide this configuration information in a Movie Toolbox user data list. Typically, you obtain this configuration data from the SGGetChannelSettings function, which is discussed in the previous section.

RESULT CODES

noDeviceForChannel

-9400

Channel component cannot find its device

couldntGetRequiredComponent

-9405

Component not found

deviceCantMeetRequest

-9408

Device cannot support grabber

SEE ALSO

You may set the configuration of all of the sequence grabber's channels by using the SGSetSettings function. This function is described on SGSetSettings .


© 1997 Apple Computer, Inc.

Previous | Chapter Top | Chapter Contents | Next